package com.ruoyi.solidProdution.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.solidProdution.mapper.CftzInfoMapper;
import com.ruoyi.solidProdution.domain.CftzInfo;
import com.ruoyi.solidProdution.service.ICftzInfoService;

/**
 * 产废台账Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-09-02
 */
@Service
public class CftzInfoServiceImpl implements ICftzInfoService 
{
    @Autowired
    private CftzInfoMapper cftzInfoMapper;

    /**
     * 查询产废台账
     * 
     * @param cftzId 产废台账ID
     * @return 产废台账
     */
    @Override
    public CftzInfo selectCftzInfoById(Long cftzId)
    {
        return cftzInfoMapper.selectCftzInfoById(cftzId);
    }

    /**
     * 查询产废台账列表
     * 
     * @param cftzInfo 产废台账
     * @return 产废台账
     */
    @Override
    public List<CftzInfo> selectCftzInfoList(CftzInfo cftzInfo)
    {
        return cftzInfoMapper.selectCftzInfoList(cftzInfo);
    }

    /**
     * 新增产废台账
     * 
     * @param cftzInfo 产废台账
     * @return 结果
     */
    @Override
    public int insertCftzInfo(CftzInfo cftzInfo)
    {
        cftzInfo.setCreateTime(DateUtils.getNowDate());
        return cftzInfoMapper.insertCftzInfo(cftzInfo);
    }

    /**
     * 修改产废台账
     * 
     * @param cftzInfo 产废台账
     * @return 结果
     */
    @Override
    public int updateCftzInfo(CftzInfo cftzInfo)
    {
        cftzInfo.setUpdateTime(DateUtils.getNowDate());
        return cftzInfoMapper.updateCftzInfo(cftzInfo);
    }

    /**
     * 批量删除产废台账
     * 
     * @param cftzIds 需要删除的产废台账ID
     * @return 结果
     */
    @Override
    public int deleteCftzInfoByIds(Long[] cftzIds)
    {
        return cftzInfoMapper.deleteCftzInfoByIds(cftzIds);
    }

    /**
     * 删除产废台账信息
     * 
     * @param cftzId 产废台账ID
     * @return 结果
     */
    @Override
    public int deleteCftzInfoById(Long cftzId)
    {
        return cftzInfoMapper.deleteCftzInfoById(cftzId);
    }
}
